using System.Collections.Generic;
using Verse;

namespace RimWorld.Planet;

public class DestroyedSettlement : MapParent
{
	public override bool ShouldRemoveMapNow(out bool alsoRemoveWorldObject)
	{
		if (!base.Map.mapPawns.AnyPawnBlockingMapRemoval)
		{
			alsoRemoveWorldObject = true;
			return true;
		}
		alsoRemoveWorldObject = false;
		return false;
	}

	public override IEnumerable<Gizmo> GetGizmos()
	{
		foreach (Gizmo gizmo in base.GetGizmos())
		{
			yield return gizmo;
		}
		if (base.HasMap && Find.WorldSelector.SingleSelectedObject == this)
		{
			yield return SettleInExistingMapUtility.SettleCommand(base.Map, requiresNoEnemies: false);
		}
	}
}
